package xian.woniuxy.hisbe.entity;

import java.util.ArrayList;
import java.util.List;

public class MedicineExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public MedicineExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andMedIdIsNull() {
            addCriterion("med_id is null");
            return (Criteria) this;
        }

        public Criteria andMedIdIsNotNull() {
            addCriterion("med_id is not null");
            return (Criteria) this;
        }

        public Criteria andMedIdEqualTo(Integer value) {
            addCriterion("med_id =", value, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdNotEqualTo(Integer value) {
            addCriterion("med_id <>", value, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdGreaterThan(Integer value) {
            addCriterion("med_id >", value, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("med_id >=", value, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdLessThan(Integer value) {
            addCriterion("med_id <", value, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdLessThanOrEqualTo(Integer value) {
            addCriterion("med_id <=", value, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdIn(List<Integer> values) {
            addCriterion("med_id in", values, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdNotIn(List<Integer> values) {
            addCriterion("med_id not in", values, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdBetween(Integer value1, Integer value2) {
            addCriterion("med_id between", value1, value2, "medId");
            return (Criteria) this;
        }

        public Criteria andMedIdNotBetween(Integer value1, Integer value2) {
            addCriterion("med_id not between", value1, value2, "medId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdIsNull() {
            addCriterion("medcatory_id is null");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdIsNotNull() {
            addCriterion("medcatory_id is not null");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdEqualTo(Integer value) {
            addCriterion("medcatory_id =", value, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdNotEqualTo(Integer value) {
            addCriterion("medcatory_id <>", value, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdGreaterThan(Integer value) {
            addCriterion("medcatory_id >", value, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("medcatory_id >=", value, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdLessThan(Integer value) {
            addCriterion("medcatory_id <", value, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdLessThanOrEqualTo(Integer value) {
            addCriterion("medcatory_id <=", value, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdIn(List<Integer> values) {
            addCriterion("medcatory_id in", values, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdNotIn(List<Integer> values) {
            addCriterion("medcatory_id not in", values, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdBetween(Integer value1, Integer value2) {
            addCriterion("medcatory_id between", value1, value2, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedcatoryIdNotBetween(Integer value1, Integer value2) {
            addCriterion("medcatory_id not between", value1, value2, "medcatoryId");
            return (Criteria) this;
        }

        public Criteria andMedNameIsNull() {
            addCriterion("med_name is null");
            return (Criteria) this;
        }

        public Criteria andMedNameIsNotNull() {
            addCriterion("med_name is not null");
            return (Criteria) this;
        }

        public Criteria andMedNameEqualTo(String value) {
            addCriterion("med_name =", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameNotEqualTo(String value) {
            addCriterion("med_name <>", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameGreaterThan(String value) {
            addCriterion("med_name >", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameGreaterThanOrEqualTo(String value) {
            addCriterion("med_name >=", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameLessThan(String value) {
            addCriterion("med_name <", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameLessThanOrEqualTo(String value) {
            addCriterion("med_name <=", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameLike(String value) {
            addCriterion("med_name like", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameNotLike(String value) {
            addCriterion("med_name not like", value, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameIn(List<String> values) {
            addCriterion("med_name in", values, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameNotIn(List<String> values) {
            addCriterion("med_name not in", values, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameBetween(String value1, String value2) {
            addCriterion("med_name between", value1, value2, "medName");
            return (Criteria) this;
        }

        public Criteria andMedNameNotBetween(String value1, String value2) {
            addCriterion("med_name not between", value1, value2, "medName");
            return (Criteria) this;
        }

        public Criteria andMedStockIsNull() {
            addCriterion("med_stock is null");
            return (Criteria) this;
        }

        public Criteria andMedStockIsNotNull() {
            addCriterion("med_stock is not null");
            return (Criteria) this;
        }

        public Criteria andMedStockEqualTo(Integer value) {
            addCriterion("med_stock =", value, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockNotEqualTo(Integer value) {
            addCriterion("med_stock <>", value, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockGreaterThan(Integer value) {
            addCriterion("med_stock >", value, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockGreaterThanOrEqualTo(Integer value) {
            addCriterion("med_stock >=", value, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockLessThan(Integer value) {
            addCriterion("med_stock <", value, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockLessThanOrEqualTo(Integer value) {
            addCriterion("med_stock <=", value, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockIn(List<Integer> values) {
            addCriterion("med_stock in", values, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockNotIn(List<Integer> values) {
            addCriterion("med_stock not in", values, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockBetween(Integer value1, Integer value2) {
            addCriterion("med_stock between", value1, value2, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedStockNotBetween(Integer value1, Integer value2) {
            addCriterion("med_stock not between", value1, value2, "medStock");
            return (Criteria) this;
        }

        public Criteria andMedPriceIsNull() {
            addCriterion("med_price is null");
            return (Criteria) this;
        }

        public Criteria andMedPriceIsNotNull() {
            addCriterion("med_price is not null");
            return (Criteria) this;
        }

        public Criteria andMedPriceEqualTo(Float value) {
            addCriterion("med_price =", value, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceNotEqualTo(Float value) {
            addCriterion("med_price <>", value, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceGreaterThan(Float value) {
            addCriterion("med_price >", value, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceGreaterThanOrEqualTo(Float value) {
            addCriterion("med_price >=", value, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceLessThan(Float value) {
            addCriterion("med_price <", value, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceLessThanOrEqualTo(Float value) {
            addCriterion("med_price <=", value, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceIn(List<Float> values) {
            addCriterion("med_price in", values, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceNotIn(List<Float> values) {
            addCriterion("med_price not in", values, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceBetween(Float value1, Float value2) {
            addCriterion("med_price between", value1, value2, "medPrice");
            return (Criteria) this;
        }

        public Criteria andMedPriceNotBetween(Float value1, Float value2) {
            addCriterion("med_price not between", value1, value2, "medPrice");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}